package com.test.p14templatemethod.example01;

import com.test.p10proxy.example01.Searcher;

/**
 * 字符显示类
 * @author bcc
 */
public class CharDisplay extends AbstractDisplay{

    /**
     * 需显示的字符
     */
    private char ch;

    /**
     * 构造函数中接收显示字符
     * @param ch
     */
    public CharDisplay(char ch){
        this.ch = ch ;
    }

    @Override
    public void open() {
        System.out.print("<<");
    }

    @Override
    public void print() {
        System.out.print(ch);
    }

    @Override
    public void close() {
        System.out.print(">>");
    }
}
